home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_08 / saks / strq3.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-12  |  638 b   |  38 lines

  1. Listing 4 - class and inline member function definitions for a type-safe 
  2. queue of str wrapped around a genq
  3.  
  4. //
  5. // strq3.h - a type-safe wrapper for a queue of str
  6. // wrapped around a genq
  7. //
  8.  
  9. #include "genq3.h"
  10. #include "str.h"
  11.  
  12. class strq
  13.     {
  14. public:
  15.     ~strq();
  16.     void append(const str &e);
  17.     void apply(void f(void *p));
  18.     void clear();
  19.     int remove(str &e);
  20. private:
  21.     genq gq;
  22.     };
  23.  
  24. inline strq::~strq()
  25.     {
  26.     clear();
  27.     }
  28.  
  29. inline void strq::append(const str &e)
  30.     {
  31.     gq.append(new str (e));
  32.     }
  33.  
  34. inline void strq::apply(void f(void *))
  35.     {
  36.     gq.apply(f);
  37.     }
  38.